package com.leadingsoft.pwxk.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.ProductMaterialDto;
import com.leadingsoft.pwxk.model.ProductMaterial;

/**
 * @author: lipan 2018年5月15日
 * @description: ()
 * 
 */

@Component
public class ProductMaterialConverter extends AbstractConverter<ProductMaterial, ProductMaterialDto> {

	@Autowired
	private FuelInfoConverter fuelInfoConverter;

	@Autowired
	private ProductMaterialInfoConverter productMaterialInfoConverter;
	@Autowired
	private ProductSolventConverter productSolventConverter;
	
	@Autowired
	private ProductPotionConverter productPotionConverter;
	
	

	@Override
	protected ProductMaterialDto toDtoActual(ProductMaterial model) {

		ProductMaterialDto dto = new ProductMaterialDto();
		dto.setId(model.getId());
		dto.setDataid(model.getDataid());
		dto.setFuelInfoList(fuelInfoConverter.toDto(model.getFuelInfoList()));
		dto.setMaterialInfoList(productMaterialInfoConverter.toDto(model.getMaterialInfoList()));
		dto.setSolventList(productSolventConverter.toDto(model.getSolventList()));
		dto.setPotion(productPotionConverter.toDto(model.getPotion()));
		return dto;
	}

	@Override
	public void copyProperties(ProductMaterial model, ProductMaterialDto dto) {

	}

}
